export interface Student {
  id: string;
  name: string;
  studentId: string;
  className: string;
  avatar?: string;
}

export interface ExamResult {
  id: string;
  examName: string;
  studentId: string;
  score: number;
  totalScore: number;
  submitTime: string;
  answers: {
    questionId: string;
    score: number;
    maxScore: number;
    answer: string;
    isCorrect: boolean;
    knowledge: string[];
  }[];
}

export interface KnowledgePoint {
  id: string;
  name: string;
  description: string;
  parentId?: string;
  level: number;
}

export interface StudentPerformance {
  studentId: string;
  examResults: ExamResult[];
  knowledgePoints: {
    [key: string]: {
      mastery: number; // 0-100
      trend: number[]; // 最近几次考试的掌握度变化
      weakPoints: string[]; // 需要加强的知识点
    };
  };
  attendance: {
    total: number;
    present: number;
    late: number;
    absent: number;
  };
  homeworkCompletion: {
    total: number;
    completed: number;
    onTime: number;
    late: number;
    quality: number; // 0-100
  };
}

export interface ClassPerformance {
  className: string;
  studentCount: number;
  averageScore: number;
  scoreDistribution: {
    range: string;
    count: number;
  }[];
  knowledgePoints: {
    [key: string]: {
      averageMastery: number;
      distribution: {
        level: string;
        count: number;
      }[];
    };
  };
  topStudents: {
    studentId: string;
    score: number;
  }[];
  needHelp: {
    studentId: string;
    weakPoints: string[];
    averageScore: number;
  }[];
}
